package bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Component
//@Component("sb")
//@Controller
//@Service
//@Repository
@Lazy
@Scope("prototype")
public class SomeBean {

//    @Autowired
//    private OtherBean otherBean;


//    @Autowired
//    @Qualifier("ob")
//    private OtherBean otherBean;

//    @Resource
//    private OtherBean otherBean;

    @Resource(name="ob")
    private OtherBean otherBean;


    public void doSome(){
        System.out.println("SomeBean.doSome()");
    }

    public OtherBean getOtherBean() {
        return otherBean;
    }

    public void setOtherBean(OtherBean otherBean) {
        this.otherBean = otherBean;
    }
}
